<template>
    <div class="select-box">
        <el-select clearable :placeholder="config.placeholder" value-key="data" v-model="filterInfo[config.filterKey]">
            <el-option
                v-for="item in config.options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
            />
        </el-select>
    </div>
</template>

<script setup lang="ts">
interface IOption {
    filterKey: string, // 绑定的字段
    type: 'select' | 'input', // 类型（重点）
    placeholder?: string,
    label: string,  // 渲染的名字
    filterable?: true, // 是否支持过滤
    options?: []   // 选项框的选项
}
interface ISelectProps {
    config: IOption;
    filterInfo: any
}
const props = defineProps<ISelectProps>()
</script>

<style scoped lang="scss">
.select-box {
    display: inline-block;
}
</style>
